﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MessageRouter.Msmq
{
    internal sealed class MsmqEndpointAddress
    {
        private readonly string serverName;
        private readonly string queueName;

        public MsmqEndpointAddress(Uri address)
        {
            this.serverName = address.GetComponents(UriComponents.Host, UriFormat.Unescaped);
            this.queueName = address.GetComponents(UriComponents.Path, UriFormat.Unescaped);
        }

        public string ServerName
        {
            get { return this.serverName; }
        }

        public string QueueName
        {
            get { return this.queueName; }
        }
    }
}
